using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Blazing.WebFacade;
using System.Web.Configuration;
using Blazing.WebFacade.CmsExtensions;
using System.Collections.Specialized;

public partial class Masterpages_Default : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        txtVersion.Text = typeof(Blazing.BusinessObjects.Cms.Site).Assembly.GetName().Version.ToString();

        TreeNodeCollection collection = new TreeNodeCollection();
        //Load extras menu
        NameValueCollection extensions = WebConfigurationManager.GetSection("InterfaceControllers") as NameValueCollection;
        foreach (string entry in extensions)
        {
            string type = (string)extensions[entry];
            Type t = Type.GetType(type);
            if (t != null)
            {
                IAdminInterfaceController controller = (IAdminInterfaceController)Activator.CreateInstance(t);
                foreach (TreeNode n in controller.ExtrasMenu)
                    collection.Add(n);
            }
        }

        RepeaterExtras.DataSource = collection;
        RepeaterExtras.DataBind();
    }

    
}
